//
//  SleepCoordinator.swift
//  ExtremeHealth
//
//  Created by Zhongkai Li 李忠凯 on 2018/9/29.
//  Copyright © 2018 GanDongKeJi. All rights reserved.
//

class SleepCoordinator: Coordinator {
    var childCoordinators = [Coordinator]()
    var navigationController: UINavigationController

    init(navigationController: UINavigationController) {
        self.navigationController = navigationController
    }

    func start() {
        let storyboard = UIStoryboard.fromName("Sleep")
        let controller = storyboard.instantiateViewController(withIdentifier: "alarm")
        controller.hidesBottomBarWhenPushed = true
        controller.withBack()
        navigationController.hideHairLine()
        navigationController.setNavigationBarHidden(false, animated: false)
        navigationController.navigationBar.barStyle = .black
        navigationController.pushViewController(controller, animated: true)
    }

    func sleep() {
        let storyboard = UIStoryboard.fromName("Sleep")
        let controller = storyboard.instantiateViewController(withIdentifier: "sleep")
        navigationController.setNavigationBarHidden(true, animated: false)
        navigationController.pushViewController(controller, animated: true)
    }

    func record() {
        let storyboard = UIStoryboard.fromName("Sleep")
        let controller = storyboard.instantiateViewController(withIdentifier: "sleepRecord")
        controller.withBack()
        navigationController.pushViewController(controller, animated: true)
    }

    func aidSleep() {
        let storyboard = UIStoryboard.fromName("Sleep")
        let controller = storyboard.instantiateViewController(withIdentifier: "sleepAid")
        controller.withBack()
        navigationController.pushViewController(controller, animated: true)
    }
}
